const express = require("express");

const Router = express.Router();

const loginHandler = require("../router_handler/login")

const expressJoi = require("@escook/express-joi");
const rulesSchema = require("../rules/login");


Router.post("/register", expressJoi(rulesSchema.login), loginHandler.register);

Router.post("/login", expressJoi(rulesSchema.login), loginHandler.login);

Router.post("/getEmailCode", expressJoi(rulesSchema.getEmailCode), loginHandler.getEmailCode)

Router.post("/verifyEmailCode", expressJoi(rulesSchema.verifyEmailCode), loginHandler.verifyEmailCode)

Router.post("/updatePassword", expressJoi(rulesSchema.updatePassword), loginHandler.updatePassword)


module.exports = Router